home *** CD-ROM | disk | FTP | other *** search
/ Champak 125 / Vol 125 (Damaged).iso / games / rabbit_r.swf / scripts / __Packages / disney / rabbitRivalry / Sounds.as < prev    next >
Encoding:
Text File  |  2009-06-09  |  3.8 KB  |  136 lines

  1. class disney.rabbitRivalry.Sounds extends smashing.sound.SoundEngine
  2. {
  3.    var __currentMusic;
  4.    var muteMusic;
  5.    var muteSound;
  6.    var __currentVO;
  7.    static var __instance;
  8.    var __DEPTH = 20;
  9.    var __DO_OVERWRITE = false;
  10.    function Sounds()
  11.    {
  12.       super();
  13.    }
  14.    static function init()
  15.    {
  16.       disney.rabbitRivalry.Sounds.__instance = new disney.rabbitRivalry.Sounds();
  17.    }
  18.    static function getInstance()
  19.    {
  20.       return disney.rabbitRivalry.Sounds.__instance;
  21.    }
  22.    function generateSounds(path)
  23.    {
  24.       super.generateSounds(path,this.__DEPTH,this.__DO_OVERWRITE);
  25.       this.createGroup("music");
  26.       this.createSound("splash","Splash_loop.wav","music");
  27.       this.createSound("game","Game_loop.wav","music");
  28.       this.changeVolume(50,"music");
  29.       this.createSound("yinyangyo","YinYangYo_Intro_short.wav");
  30.       this.createSound("bonk","roach_hit.wav");
  31.       this.createSound("yoHit1","Yo_hey.wav");
  32.       this.createSound("yoHit2","Yo_what-the-heck.wav");
  33.       this.createSound("yangattack","yang_attack.wav");
  34.       this.createSound("yinattack","yin_attack.wav");
  35.       this.createSound("yoWin1","Yo_i-hope-you-got-your-learing-caps-on.wav");
  36.       this.createSound("yoWin2","Yo_responsibility.wav");
  37.       this.createSound("yoWin3","Yo_material-posessions.wav");
  38.       this.createSound("yoWin4","Yo_self-sacrifice.wav");
  39.       this.createSound("bash","CRASH R.wav");
  40.       this.createSound("yin_attack1","Yin_ha-yee.wav");
  41.       this.createSound("yin_attack2","Yin_yincinerate.wav");
  42.       this.createSound("yin_attack3","Yin_foofield.wav");
  43.       this.createSound("yang_attack1","Yang_he-hoo-ha.wav");
  44.       this.createSound("yang_attack2","Yang_ah-yeah.wav");
  45.       this.createSound("yang_attack3","Yang_foonado.wav");
  46.       this.__currentMusic = "";
  47.       this.muteMusic = false;
  48.    }
  49.    function playLevelEndSound()
  50.    {
  51.       var _loc2_ = disney.rabbitRivalry.GameState.getInstance().levelNum;
  52.       this.playSound("yoWin" + _loc2_);
  53.    }
  54.    function playSound(name, loops, t_queued)
  55.    {
  56.       if(this.muteSound == true)
  57.       {
  58.          return undefined;
  59.       }
  60.       super.playSound(name,loops,t_queued);
  61.    }
  62.    function p(name)
  63.    {
  64.       this.playSound(name,1);
  65.    }
  66.    function q(name)
  67.    {
  68.       this.queueSound(name);
  69.    }
  70.    function c(name, cbpath, cbfunc)
  71.    {
  72.       this.callbackSound(name,1,cbpath,cbfunc);
  73.    }
  74.    function playMusic(name)
  75.    {
  76.       if(this.muteMusic)
  77.       {
  78.          this.__currentMusic = name;
  79.          return undefined;
  80.       }
  81.       if(this.__currentMusic != "" && this.__currentMusic != undefined)
  82.       {
  83.          this.stopMusic();
  84.       }
  85.       this.__currentMusic = name;
  86.       this.playSound(this.__currentMusic,0);
  87.    }
  88.    function restartMusic()
  89.    {
  90.       if(this.muteMusic)
  91.       {
  92.          return undefined;
  93.       }
  94.       if(this.__currentMusic == "" || this.__currentMusic == undefined)
  95.       {
  96.          return undefined;
  97.       }
  98.       this.playMusic(this.__currentMusic);
  99.    }
  100.    function stopMusic()
  101.    {
  102.       this.stopSound(this.__currentMusic);
  103.    }
  104.    function playOptional(t_name)
  105.    {
  106.       if(!this.isQueuePlaying)
  107.       {
  108.          this.queueSound(t_name);
  109.       }
  110.    }
  111.    function playVoiceOver(name)
  112.    {
  113.       this.stopSound(this.__currentVO);
  114.       this.__currentVO = name;
  115.       if(disney.rabbitRivalry.GameState.getInstance().isYang)
  116.       {
  117.          this.__currentVO = "yang_" + this.__currentVO;
  118.       }
  119.       else
  120.       {
  121.          this.__currentVO = "yin_" + this.__currentVO;
  122.       }
  123.       this.playSound(this.__currentVO);
  124.    }
  125.    function musicOff()
  126.    {
  127.       this.muteMusic = true;
  128.       this.stopMusic();
  129.    }
  130.    function musicOn()
  131.    {
  132.       this.muteMusic = false;
  133.       this.playMusic(this.__currentMusic);
  134.    }
  135. }
  136.